from django.contrib import admin

from models import *

admin.site.register(World)

def mark_deleted(modeladmin, request, queryset):
  #queryset.update(state='D')
  for object in queryset:
    object.state = 'D'
    object.save() 
mark_deleted.short_description = "Mark selected objects as deleted"

class ObjectAdmin(admin.ModelAdmin):
    actions = [mark_deleted]

admin.site.register(Object, ObjectAdmin)


class TerrainModifierAdmin(admin.ModelAdmin):
    actions = [mark_deleted]

admin.site.register(TerrainModifier, TerrainModifierAdmin)
